package com.kunge2013.chatbi.functioncall;

import org.springframework.ai.model.function.FunctionCallback;
import org.springframework.ai.model.function.FunctionCallbackWrapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.function.Function;

/**
 * @Author kunge2013
 * @Description 函数调用配置
 * @Date 2024/11/11 19:11
 * @Version 1.0
 */


@Configuration
public class FunctionConfig {
    @Bean
    public FunctionCallback weatherFunctionInfo() {
        return
                /*(1) function name*/
                /*(2) function description*/
                /*function code*/
                FunctionCallbackWrapper
                            .builder(new WeatherService())
                            .withName("currentWeather")
                            .withDescription("Get the weather in location").build();
    }
}